
import static org.junit.Assert.*;

import org.junit.Test;


public class InputParserTest {
    
	InputParser inputParser = new InputParser("hello");


	@Test
	public void testNumeric() {
		/* This is the equivalence partition for Strings*/
		assertFalse(InputParser.isNumeric(""));
		assertFalse(InputParser.isNumeric(null));

		assertFalse(InputParser.isNumeric("."));

		assertFalse(InputParser.isNumeric("a"));
		assertFalse(InputParser.isNumeric("cba"));

		/* This is a boundary case for the positive partition*/
		assertTrue(InputParser.isNumeric("1"));
		assertTrue(InputParser.isNumeric("0"));

		/* This is a boundary case for the negative partition*/
		assertFalse(InputParser.isNumeric("-1"));
		assertFalse(InputParser.isNumeric("-2"));

	}

	@Test
	public void testParseListType() {
		/* This is the equivalence partition for Strings*/
		try {

			inputParser.parseListType("");
			assertEquals(inputParser.getListType(), "");
			inputParser.parseListType(null);
			assertEquals(inputParser.getListType(), "");

			inputParser.parseListType("done");
			assertEquals(inputParser.getListType(), "done");

			/* This is a boundary case for the type is substring partition */
			inputParser.parseListType("undone");
			assertEquals(inputParser.getListType(), "");


		} catch (Exception e) {

		}
	}
}
